var mongoose = require("mongoose");
var db = require('./db');
var newsModel = db.model("article",new mongoose.Schema({
    title:{
        type: String,
        required:true,
    },
    top:{
        type:Boolean,
        default: false,
    },
    type:{
        type: Number,
        required:true,
    },
    author:{
        type: String,
        required:true,
    },
    content:{
        type: String,
        required:true,
    },
    date:{
        type: Date,
        required: true
    },
    like:{
        type: Number,
        default: 0,
    },
    cover:{
        type: String,
        required:true,
    },
    deleted:{
        type: Boolean,
        default:false,
    },
    people:{//点赞的人
        type:Array,
        default: []
    }
}), "article");

//数据库里面的一个表
module.exports =  newsModel;